<?php
declare(strict_types=1);
namespace App\Dao;

use App\Constants\ErrorCode;
use App\Exception\BusinessException;
use App\Model\RechargeType as Model;


class RechargeTypeDao {

    use DaoTrait;
    
    public function __construct()
    {
        $this->driver=__CLASS__;    
    }

    //根据条件获取所有内容
    public function getByWhere($map=[])
    {
        return  Model::when(!empty($map),function($query) use($map){
            $query->where($map);
        })->get()->each(function($value){
            $value->append(['status_mapping','link_type_mapping']);
        });
    }

  

}